﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace LogManager.Base.Models.Event.Filter
{
    /// <summary>
    /// A filter that specifies the event type of an event and a property and value
    /// If a property is null it won't be filtered
    /// </summary>
    public class EventTypeFilter : IEventTypeFilter
    {
        public EventTypeFilter()
        {
            Type = "Undefined";
        }

        public EventTypeFilter(string eventType)
        {
            Type = eventType;
        }

        /// <summary>
        /// Event type to filter
        /// </summary>
        [Required]
        [DisplayName("Event Type")]
        public string Type { get; set; }

        /// <summary>
        /// Name of the property to filter, the property has to exist at least
        /// </summary>
        [DisplayName("Property Name")]
        public string PropertyName { get; set; }

        /// <summary>
        /// If a property value is given the property with the propertyName will be validatet against this value
        /// </summary>
        [DisplayName("Property Value")]
        public string PropertyValue { get; set; }  
    }
}